• Image placeholder
  • 홈 페이지
  • 블로그 센터
  • 범주
Image placeholder

array 알고리즘

lgorithm | array - find pivot index

배열의 element들 중 특정 값의 왼쪽에 있는 숫자들의 합과 오른쪽에 있는 합이 같을 때 그 숫자를 pivot이라 하고 pivot의 인덱스를 리턴하는 문제입니다. 위와 같은 경우 9의 왼쪽의 element들의 합은 11이고 오른쪽 element들의 합은 11이기 때문에 9는 pivot이 되고 index 3이 리턴됩니다. 위 배열의 경우 pivot이 존재할 수 없고 -1을 리턴하면 정답이 ...

array 알고리즘array 알고리즘

© 2022 intrepidgeeks.com

Privacy Policy Contact US Sitemap
🍪 This website uses cookies to ensure you get the best experience on our website. Learn more